using B.S.XZYData.ErrorCode;
using MediatR;

namespace B.S.XZYData.Api.Wrter.Application.Command.SalesOrder
{
    /// <summary>
    /// 新增销售订单命令
    /// </summary>
    public class AddSalesOrderCommand : IRequest<ApiResult<int>>
    {
        /// <summary>
        /// 单据编号
        /// </summary>
        public string? OrderNo { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string? Remark { get; set; }

        /// <summary>
        /// 产品明细列表
        /// </summary>
        public List<SalesOrderProductModel> Products { get; set; } = new List<SalesOrderProductModel>();
    }

    /// <summary>
    /// 销售订单产品明细模型
    /// </summary>
    public class SalesOrderProductModel
    {
        /// <summary>
        /// 产品编号
        /// </summary>
        public string ProductCode { get; set; } = string.Empty;

        /// <summary>
        /// 产品名称
        /// </summary>
        public string ProductName { get; set; } = string.Empty;

        /// <summary>
        /// 产品规格
        /// </summary>
        public string? ProductSpec { get; set; }

        /// <summary>
        /// 工单编号
        /// </summary>
        public string WorkOrderNo { get; set; } = string.Empty;

        /// <summary>
        /// 订单数量
        /// </summary>
        public int Quantity { get; set; }
    }
}
